import { eventHandler, getRouterParam } from 'h3';

export default eventHandler(async (event) => {
  const id = getRouterParam(event, 'id');
  // 删除
  MOCK_ROLE_LIST_DATA.splice(
    MOCK_ROLE_LIST_DATA.findIndex((item) => item.id === Number(id)),
    1,
  );

  return useResponseSuccess({
    res: true,
    message: '删除角色成功',
    id,
  });
});
